package cn.iocoder.yudao.module.strategyPlanUser.dal.mysql.strategyPlanUser;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.strategyPlanUser.dal.dataobject.strategyPlanUser.StrategyPlanUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.strategyPlanUser.controller.admin.strategyPlanUser.vo.*;

/**
 * 企业战略-计划-人力落地表（短期、长期） Mapper
 *
 * @author huangjunwei
 */
@Mapper
public interface StrategyPlanUserMapper extends BaseMapperX<StrategyPlanUserDO> {

    default PageResult<StrategyPlanUserDO> selectPage(StrategyPlanUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StrategyPlanUserDO>()
                .eqIfPresent(StrategyPlanUserDO::getId, reqVO.getId())
                .eqIfPresent(StrategyPlanUserDO::getOrganizationId, reqVO.getOrganizationId())
                .eqIfPresent(StrategyPlanUserDO::getStrategyId, reqVO.getStrategyId())
                .eqIfPresent(StrategyPlanUserDO::getStrategyPlanId, reqVO.getStrategyPlanId())
                .eqIfPresent(StrategyPlanUserDO::getUserId, reqVO.getUserId())
                .likeIfPresent(StrategyPlanUserDO::getWorkTarget, reqVO.getWorkTarget())
                .likeIfPresent(StrategyPlanUserDO::getWorkContent, reqVO.getWorkContent())
                .eqIfPresent(StrategyPlanUserDO::getResponseRole, reqVO.getResponseRole())
                .betweenIfPresent(StrategyPlanUserDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(StrategyPlanUserDO::getEndTime, reqVO.getEndTime())
                .betweenIfPresent(StrategyPlanUserDO::getRealStartTime, reqVO.getRealStartTime())
                .betweenIfPresent(StrategyPlanUserDO::getRealEndTime, reqVO.getRealEndTime())
                .eqIfPresent(StrategyPlanUserDO::getStatus, reqVO.getStatus())
                .likeIfPresent(StrategyPlanUserDO::getRemark, reqVO.getRemark())
                .eqIfPresent(StrategyPlanUserDO::getLeaderId, reqVO.getLeaderId())
                .betweenIfPresent(StrategyPlanUserDO::getSelfScore, reqVO.getSelfScore())
                .likeIfPresent(StrategyPlanUserDO::getLeaderComment, reqVO.getLeaderComment())
                .eqIfPresent(StrategyPlanUserDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(StrategyPlanUserDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StrategyPlanUserDO::getUpdater, reqVO.getUpdater())
                .betweenIfPresent(StrategyPlanUserDO::getUpdateTime, reqVO.getUpdateTime())
                .eqIfPresent(StrategyPlanUserDO::getDeleted, reqVO.getDeleted())
                .eqIfPresent(StrategyPlanUserDO::getTenantId, reqVO.getTenantId())
                .eqIfPresent(StrategyPlanUserDO::getSelfComment, reqVO.getSelfComment())
                .eqIfPresent(StrategyPlanUserDO::getLeaderScore, reqVO.getLeaderScore())
                .orderByDesc(StrategyPlanUserDO::getId));
    }

    default List<StrategyPlanUserDO> selectList(StrategyPlanUserExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StrategyPlanUserDO>()
                .eqIfPresent(StrategyPlanUserDO::getId, reqVO.getId())
                .eqIfPresent(StrategyPlanUserDO::getOrganizationId, reqVO.getOrganizationId())
                .eqIfPresent(StrategyPlanUserDO::getStrategyId, reqVO.getStrategyId())
                .eqIfPresent(StrategyPlanUserDO::getStrategyPlanId, reqVO.getStrategyPlanId())
                .eqIfPresent(StrategyPlanUserDO::getUserId, reqVO.getUserId())
                .likeIfPresent(StrategyPlanUserDO::getWorkTarget, reqVO.getWorkTarget())
                .likeIfPresent(StrategyPlanUserDO::getWorkContent, reqVO.getWorkContent())
                .eqIfPresent(StrategyPlanUserDO::getResponseRole, reqVO.getResponseRole())
                .betweenIfPresent(StrategyPlanUserDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(StrategyPlanUserDO::getEndTime, reqVO.getEndTime())
                .betweenIfPresent(StrategyPlanUserDO::getRealStartTime, reqVO.getRealStartTime())
                .betweenIfPresent(StrategyPlanUserDO::getRealEndTime, reqVO.getRealEndTime())
                .eqIfPresent(StrategyPlanUserDO::getStatus, reqVO.getStatus())
                .likeIfPresent(StrategyPlanUserDO::getRemark, reqVO.getRemark())
                .eqIfPresent(StrategyPlanUserDO::getLeaderId, reqVO.getLeaderId())
                .betweenIfPresent(StrategyPlanUserDO::getSelfScore, reqVO.getSelfScore())
                .likeIfPresent(StrategyPlanUserDO::getLeaderComment, reqVO.getLeaderComment())
                .eqIfPresent(StrategyPlanUserDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(StrategyPlanUserDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(StrategyPlanUserDO::getUpdater, reqVO.getUpdater())
                .betweenIfPresent(StrategyPlanUserDO::getUpdateTime, reqVO.getUpdateTime())
                .eqIfPresent(StrategyPlanUserDO::getDeleted, reqVO.getDeleted())
                .eqIfPresent(StrategyPlanUserDO::getTenantId, reqVO.getTenantId())
                .eqIfPresent(StrategyPlanUserDO::getSelfComment, reqVO.getSelfComment())
                .eqIfPresent(StrategyPlanUserDO::getLeaderScore, reqVO.getLeaderScore())
                .orderByDesc(StrategyPlanUserDO::getId));
    }

}
